<?php
ini_set('display_errors',1);
error_reporting(E_ALL);

define('ROOT', '../../src/');
set_include_path(get_include_path() . PATH_SEPARATOR . ROOT);

if(array_key_exists('src', $_REQUEST)){
	include_once 'core/Shorp.php';
	include_once 'interpreter/Interpreter.php';
	
	$src = urldecode($_REQUEST['src']);
	if(get_magic_quotes_gpc()){
	    $src = stripslashes($src);
	}

	$shorp = new Shorp();
	$shorp->add($src);
	$shorp->interpreter(new Interpreter());

	require 'header.html';
	echo $shorp->run();
	require 'footer.html';
}else{
	header('Location: http://jquerymobile.com/demos/1.0a3/');
}
